# Contributor: Sergei Lukin <sergej.lukin@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gtk-vnc
pkgver=1.3.0
pkgrel=0
pkgdesc="VNC viewer widget for GTK"
url="https://wiki.gnome.org/Projects/gtk-vnc"
arch="all"
license="LGPL-2.1-or-later"
makedepends="gtk+3.0-dev gnutls-dev glib-dev expat-dev
	libgcrypt-dev libgpg-error-dev cyrus-sasl-dev perl-text-csv
	pulseaudio-dev gobject-introspection-dev vala meson"
source="https://download.gnome.org/sources/gtk-vnc/${pkgver%.*}/gtk-vnc-$pkgver.tar.xz"
subpackages="$pkgname-dev gvncviewer $pkgname-lang $pkgname-doc"

# secfixes:
#   0.7.0-r0:
#     - CVE-2017-5884
#     - CVE-2017-5885

build() {
	abuild-meson \
		-Dwith-vala=enabled \
		. output

	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	meson test --no-rebuild -v -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

gvncviewer() {
	pkgdesc="Demo application for gtk-vnc"
	cd $builddir
	mkdir -p "$subpkgdir"/usr/bin
	mv output/examples/gvncviewer "$subpkgdir"/usr/bin
}

sha512sums="
ff25c19a1cbd4588990f1f3a2448fd2e0b694b933ca1a7be9565188db78055efe13f90ad1243bf8237d6a29d38987d7b3e77344e50d09191207b09200b01f5df  gtk-vnc-1.3.0.tar.xz
"
